﻿using Core;
using Sirenix.OdinInspector;
using System;
using System.Collections.Generic;
using UnityEngine;

[CreateAssetMenu(menuName = "Mini/Sys/Conf/Wnd")]
public class TblWnd : AbstractSOTable<int, TblWnd.Conf>, IEnumTable
{
    [Serializable]
    public class Conf : ITableConf<int>
    {
        public int Index => Id;

        [HorizontalGroup("row0")]
        public int Id;

        [HorizontalGroup("row0")]
        public string Name;

        [HorizontalGroup("row0")]
        public EUILayer Layer;

        [HorizontalGroup("row0", Width = 0.4f)]
        public string ResPath;

        public void Awake() { }
    }

    public List<(int, string)> GetEnumList()
    {
        var list = new List<(int, string)>();
        foreach (var conf in Confs)
        {
            list.Add((conf.Id, conf.Name));
        }

        return list;
    }
}